import request from '@/utils/request'
import {appConfig} from '../../config/app'

let service = appConfig.microServModules.system + 'api/sso'
let servicePerm = appConfig.microServModules.system + 'api/permission'
let roleService = appConfig.microServModules.system + 'api/role'

export function ssoLogin (data) {
  return request(`${service}/login`, {method: 'get', data: data})
}

export function ssoLogout (data) {
  return request(`${service}/logout`, {method: 'get', data: data})
}

export function tokenValid (data) {
  return request(`${service}/valid`, {method: 'get', data: data})
}

export function loginUserInfo (data) {
  return request(`${service}/loginUserInfo`, {method: 'post', data: data})
}

export function qryModulePermByRoleId (data) {
  return request(`${servicePerm}/qryModulePermByRoleId`, {method: 'get', data: data})
}
export function syncLogin(data) {
  return request(`${service}/syncLogin`, {method: 'get', data: data})
}
export function selectRoleByUserId(data) {
  return request(`${roleService}/selectRoleByUserId`, {method: 'get', data: data})
}
